#define _CRT_SECURE_NO_WARNINGS 1


#include"list.h"

int main()
{
	yyh::list<int> l1;
	l1.push_back(1);
	l1.push_back(2);
	l1.push_back(3);
	l1.push_back(4);
	yyh::list<int>::iterator it1 = l1.begin();
	while (it1 != l1.end())
	{
		cout << *it1 << ' ';
		++it1;
	}
	cout << endl;

	for (auto& e : l1)
	{
		cout << e << ' ';
	}
	cout << endl;

	l1.push_front(5);
	l1.push_front(6);
	for (auto& e : l1)
	{
		cout << e << ' ';
	}
	cout << endl;

	l1.pop_back();
	l1.pop_front();
	for (auto& e : l1)
	{
		cout << e << ' ';
	}
	cout << endl;

	yyh::list<int> l2(l1);

	l1.clear();
	for (auto& e : l1)
	{
		cout << e << ' ';
	}
	cout << endl;

	for (auto& e : l2)
	{
		cout << e << ' ';
	}
	cout << endl;

	l1 = l2;
	for (auto& e : l1)
	{
		cout << e << ' ';
	}
	cout << endl;

	yyh::list<int> l3 = { 1, 2, 3, 4 };
	for (auto& e : l3)
	{
		cout << e << ' ';
	}
	cout << endl;

	return 0;
}